package study.search;

public class LinearSearch {
    public static void main(String[] args) {
        int[] arr = {23, 343, 35, 4, 29};
        int i = linearSearch(arr, 88);
        System.out.println(i);

    }

    public static int linearSearch(int[] arr, int findValue){
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == findValue){
                return i;
            }
        }

        return -1;
    }
}
